<!--
 * @Description: 文本垂直居中
 * @Author: zzj
 * @Date: 2021-08-25 15:42:15
 * @LastEditors: zzj
 * @LastEditTime: 2021-08-25 15:45:00
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文本垂直居中</title>
    <style>
        .box{
            background-color: wheat;
            color: white;
            height: 100px;
            text-align: center;
            /* line-height: 100px; */
        }
        .box::after{
            content: "";
            display: inline-block;
            height: 100px;
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <div class="box">
        hello world
    </div>
</body>
</html>